package com.sleep.psy.external_server.business.psy.controller;


import com.sleep.psy.external_server.business.main.entity.MainScheme;
import com.sleep.psy.external_server.business.psy.entity.PsyBaseVideo;
import com.sleep.psy.external_server.business.psy.service.PsyBaseVideoService;
import com.sleep.psy.external_server.result.Result;
import com.sleep.psy.external_server.result.ResultEnum;
import com.sleep.psy.external_server.result.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 基础视频列表 前端控制器
 * </p>
 *
 * @author wenliguo
 * @since 2025-08-12
 */
@Api(tags = "基础视频列表")
@RestController
@RequestMapping("/psyBaseVideo")
public class PsyBaseVideoController {

    protected Logger logger = LoggerFactory.getLogger(PsyBaseVideoController.class);

    @Autowired
    private PsyBaseVideoService baseVideoService;


    /**
     * 训练课程列表
     * @author wenliguo
     * @date 2025/8/21 16:34
     * @return com.sleep.psy.external_server.result.Result<java.util.List<com.sleep.psy.external_server.business.psy.entity.PsyBaseVideo>>
    */
    @GetMapping("/selectTraingList")
    @ApiOperation(value = "训练课程列表")
    public Result<List<PsyBaseVideo>> selectTraingList() {
        try {
            return baseVideoService.selectTraingList();
        } catch (Exception e) {
            logger.error("获取训练课程列表出错", e);
            return ResultUtil.error(ResultEnum.SERVER_INTERNAL_ERROR);
        }
    }

    /**
     * 冥想专项
     * @author wenliguo
     * @date 2025/8/21 16:35 
     * @return com.sleep.psy.external_server.result.Result<java.util.List<com.sleep.psy.external_server.business.psy.entity.PsyBaseVideo>>
    */
    @GetMapping("/selectMeditationList")
    @ApiOperation(value = "冥想专项")
    public Result<List<PsyBaseVideo>> selectMeditationList() {
        try {
            return baseVideoService.selectMeditationList();
        } catch (Exception e) {
            logger.error("获取冥想专项出错", e);
            return ResultUtil.error(ResultEnum.SERVER_INTERNAL_ERROR);
        }
    }

    /**
     * 睡眠训练
     * @author wenliguo
     * @date 2025/8/21 16:35 
     * @return com.sleep.psy.external_server.result.Result<java.util.List<com.sleep.psy.external_server.business.psy.entity.PsyBaseVideo>>
    */
    @GetMapping("/selectSleepList")
    @ApiOperation(value = "睡眠训练")
    public Result<List<PsyBaseVideo>> selectSleepList() {
        try {
            return baseVideoService.selectSleepList();
        } catch (Exception e) {
            logger.error("获取睡眠训练出错", e);
            return ResultUtil.error(ResultEnum.SERVER_INTERNAL_ERROR);
        }
    }

    /**
     * 放松减压
     * @author wenliguo
     * @date 2025/8/21 16:35
     * @return com.sleep.psy.external_server.result.Result<java.util.List<com.sleep.psy.external_server.business.psy.entity.PsyBaseVideo>>
    */
    @GetMapping("/selectRelaxList")
    @ApiOperation(value = "放松减压")
    public Result<List<PsyBaseVideo>> selectRelaxList() {
        try {
            return baseVideoService.selectRelaxList();
        } catch (Exception e) {
            logger.error("获取放松减压出错", e);
            return ResultUtil.error(ResultEnum.SERVER_INTERNAL_ERROR);
        }
    }
}

